This specification relates to memory management, and particularly, to sharing memory between threads of an executing process. Memory management provides ways to dynamically allocate portions of memory to the process and its individual threads at their request, and to free the portions of the memory for reuse when the memory blocks are no longer needed by the threads. Different algorithms can be used to implement the dynamic memory allocation. The choice of the memory allocation algorithm can influence how efficiently the memory is used and, as a result, impacts efficiency of the process over all.